//
//  UserinfoTableViewCell.m
//  ChatDemo-UI2.0
//
//  Created by zz on 16/5/13.
//  Copyright © 2016年 zz. All rights reserved.
//

#import "UserinfoTableViewCell.h"

@implementation UserinfoTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        UIView *superView = self.contentView;
        
        _topLabel = [[UILabel alloc] init];
        _topLabel.textColor = RGBACOLOR(0, 0, 0, 1);
        _topLabel.font = [UIFont systemFontOfSize:15];
        [superView addSubview:_topLabel];
        
        _bottomLabel = [[UILabel alloc] init];
        _bottomLabel.textColor = RGBACOLOR(151, 151, 151, 1);
        _bottomLabel.font = [UIFont systemFontOfSize:12];
        [superView addSubview:_bottomLabel];
        
        _twoDimension = [UIButton buttonWithType:UIButtonTypeCustom];
        [_twoDimension setImage:[UIImage imageNamed:@"erweunahuabtiy_grxx_3_nor"] forState:UIControlStateNormal];
        //设置BUtton不可用
        _twoDimension.enabled=NO;
        [superView addSubview:_twoDimension];
        
        [_topLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.top.equalTo(superView.mas_top).offset(12);
//            make.bottom.equalTo(self->_bottomLabel.mas_top).offset(-9);
            make.left.equalTo(superView.mas_left).offset(17);
            make.width.equalTo(@200);
            make.height.equalTo(@19);
        }];
        
        [_bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.left.equalTo(superView.mas_left).offset(17);
            make.top.equalTo(self->_topLabel.mas_bottom).offset(6);
            //make.bottom.equalTo(superView.mas_bottom).offset(-15);
            make.height.equalTo(@15);
            make.width.equalTo(@200);
        }];
        
        [_twoDimension mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.centerY.equalTo(superView.mas_centerY).offset(0);
            make.right.equalTo(superView.mas_right).offset(-11);
            
        }];
    }
    
    return self;
}

- (void)awakeFromNib {

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
